package com.zhangmeng.online.exam.entity;

import com.zhangmeng.online.exam.entity.baseEntity.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

/**
 * description: 职业实体类
 * @author zm
 * @date 2025/2/28 16:24
 * @version: 1.0
 */

@NoArgsConstructor
@Data
@AllArgsConstructor
@Entity
@EqualsAndHashCode(callSuper = false)
@Table(name = "profession")
public class Profession extends BaseEntity<Long> {


    private String name;

    @ManyToOne(fetch = FetchType.LAZY)
    private Profession parent;

    @OneToMany(mappedBy = "profession")
    private List<Subject> subjects = new ArrayList<>();
}
